home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / lib / fd / makefd.c < prev    next >
C/C++ Source or Header  |  1997-09-09  |  660b  |  35 lines

  1.  
  2. /*
  3.  *  MAKEFD.C
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  *
  9.  *  Used by routines that want to get into our low level io system.  If exec
  10.  *  is NULL then handle is an AmigaDOS file handle.  If exec is not NULL then
  11.  *  it is a function capable of executing ioctls.
  12.  */
  13.  
  14. #include <stdio.h>
  15. #include <fcntl.h>
  16.  
  17. int
  18. MakeFd(handle, flags, exec)
  19. long handle;
  20. long flags;
  21. long (*exec)();
  22. {
  23.     int fd;
  24.     _IOFDS *d = _MakeFD(&fd);
  25.  
  26.     d->fd_Fh = handle;
  27.     d->fd_Flags = flags | O_ISOPEN;
  28.     d->fd_Exec = exec;
  29.  
  30.     return(fd);
  31. }
  32.  
  33.  
  34.  
  35.